<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">{:__('退款申请')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('ID:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.id|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('退款单号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_no|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('退款类型:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.typeText|htmlentities}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单编号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.order_no|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单应付金额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.orderData.payment|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单现金支付:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.orderData.payment_rel|htmlentities}</p>
                </div>

                <label class="col-xs-12 col-sm-1 control-label">{:__('订单余额支付:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.orderData.balance|htmlentities}</p>
                </div>
            </div>
            {if condition="$row.order_item_no"}
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单商品编号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.order_item_no|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单商品应付金额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.orderItemData.payment|default=0|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单商品余额支付:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.orderItemData.balance|default=0|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单商品现金支付:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.orderItemData.payment_rel|default=0|htmlentities}</p>
                </div>
            </div>
            {/if}
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('待退回余额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.order_balance|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('申请退回余额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_balance|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('实际退回余额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_balance_rel|htmlentities}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('待退回现金:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.order_amount|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('申请退回现金:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_amount|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('实际退回现金:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_amount_rel|htmlentities}</p>
                </div>
                {if condition="$row.status == 2"}
                <label class="col-xs-12 col-sm-1 control-label">{:__('现金退回方式:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_way_text|htmlentities}</p>
                </div>
                {/if}
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('退款原因:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.reason_text|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('留言:')}</label>
                <div class="col-xs-12 col-sm-5">
                    <p class="form-control-static">{$row.comment|htmlentities}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('状态:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.statusText|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('更新时间:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.updated_at|datetime|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('创建时间:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.created_at|datetime|htmlentities}</p>
                </div>
            </div>
        </form>
    </div>
    <div class="panel-heading">
        {if condition="$row.status == 1"}
        <h3 class="panel-title">{:__('退款操作')}</h3>
        {else/}
        <h3 class="panel-title">{:__('退款编辑')}</h3>
        {/if}
    </div>
    <div class="panel-body">
        <form id="reply-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
            <input type="hidden" name="row[scenario]" value="reply" />
            {if condition="$row.status == 1"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('是否退款')}:</label>
                <div class="col-xs-12 col-sm-8">
                    {:build_radios('row[agree]', $yesOrNo, 1)}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">{:__('实际退回余额')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-refund_balance_rel" class="form-control" type="number" name="row[refund_balance_rel]" value="{$row.refund_balance|htmlentities}" title="">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">{:__('实际退回现金')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-refund_amount_rel" class="form-control" type="number" name="row[refund_amount_rel]" value="{$row.refund_amount|htmlentities}" title="">
                </div>
            </div>
            {if condition="$row.refund_amount > 0"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">{:__('现金退回方式')}:</label>
                <div class="col-xs-12 col-sm-3">
                    {:build_select('row[refund_way]', $refundWayList, null, ['class'=>'form-control selectpicker'])}
                </div>
            </div>
            {/if}
            {/if}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">{:__('退款备注')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-refund_note" class="form-control" name="row[refund_note]" title="" style="min-height: 100px">{$row.refund_note|htmlentities}</textarea>
                </div>
            </div>
            {if condition="$row.status != 4"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">{:__('退款图集')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-refund_photos" class="form-control" type="text" name="row[refund_photos]" value="{$row.refund_photos|htmlentities}" title="">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-refund_photos" class="btn btn-danger faupload" data-input-id="c-refund_photos" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-refund_photos"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-refund_photos" class="btn btn-primary fachoose" data-input-id="c-refund_photos" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-refund_photos"></span>
                    </div>
                    <ul class="row list-inline faupload-preview" id="p-refund_photos"></ul>
                </div>
            </div>
            {/if}
            {if condition="$row.refund_time"}
            <div class="form-group" >
                <label class="control-label col-xs-12 col-sm-1">{:__('处理时间')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <p class="form-control-static">{$row.refund_time|datetime|htmlentities}</p>
                </div>
            </div>
            {/if}
            <div class="form-group layer-footer">
                <label class="control-label col-xs-12 col-sm-1"></label>
                <div class="col-xs-12 col-sm-8">
                    <button class="btn btn-success btn-embossed disabled" type="submit">{:__('OK')}</button>
                    <button class="btn btn-default btn-embossed" type="reset">{:__('Reset')}</button>
                </div>
            </div>
        </form>
    </div>
</div>
<style>
    .control-label {
        width: 150px;
    }
</style>